package com.example.gymmanagement.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.gymmanagement.domain.Img;
import com.example.gymmanagement.service.ImgService;
import com.example.gymmanagement.mapper.ImgMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 蜗牛菌
* @description 针对表【img】的数据库操作Service实现
* @createDate 2023-06-07 15:48:45
*/
@Service
public class ImgServiceImpl extends ServiceImpl<ImgMapper, Img> implements ImgService{

    @Autowired
    private ImgMapper imgMapper;

    @Override
    public Img selectById(int id) {
        return this.imgMapper.selectById(id);
    }

    @Override
    public boolean insert(Img img) {
        boolean success = false;
        try {success =this.imgMapper.insert(img) >0;
        }catch (Exception e){success =false;}
        return success;
    }

    @Override
    public boolean deleteById(int id) {
        return this.imgMapper.deleteById(id) >0;
    }

    @Override
    public boolean updateImg(Img img) {
        return this.imgMapper.updateById(img) >0;
    }
}




